package jdbctest;

import com.alibaba.druid.support.spring.stat.annotation.Stat;

import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Statement;

public class JDBCDemo1 {
    public static void main(String[] args) {
        try(Connection connection = DBUtil.getConnection()) {
            Statement statement = connection.createStatement();
            String sql = "CREATE TABLE user(\n" +
                    "    id INT PRIMARY KEY AUTO_INCREMENT,\n" +
                    "    username VARCHAR(30),\n" +
                    "    password VARCHAR(30),\n" +
                    "    nickname VARCHAR(30),\n" +
                    "    age INT(3)\n" +
                    ")";
            statement.executeUpdate(sql);
            System.out.println("创建成功");
        } catch (SQLException e) {
            e.printStackTrace();
        }
    }
}
